home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000112_icon-group-sender _Fri Apr 11 08:13:13 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 14 Apr 1997 09:14:12 MST
  2. Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
  3.     id AA03068; Mon, 14 Apr 1997 09:14:12 -0700
  4. To: icon-group@cs.arizona.edu
  5. Date: Fri, 11 Apr 1997 08:13:13 -0700
  6. From: Steve Wampler <swampler@gemini.edu>
  7. Message-Id: <334E5509.2A4@gemini.edu>
  8. Organization: Gemini 8m Telescopes Project
  9. Sender: icon-group-request@cs.arizona.edu
  10. References: <334D453B.72FD@anu.edu.au>
  11. Subject: Re: Records in Icon
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14. Content-Length: 1266
  15.  
  16. Stuart Robinson wrote:
  17. > Does anyone know a way to check two fields of two entries in a record to
  18. > see whether either one of the fields in the two entries share an
  19. > identical value?
  20. > For example, given a record with three entries and 5 fields like the
  21. > following (where the 4th and 5th field are empty in entries 1 and 3)
  22. > 1       5       X
  23. > 2       5       X       6       Y
  24. > 3       6       X
  25. > how could one check to see whether successive entires (1 and 2 or 2 and
  26. > 3) share a common value in either the second or the fourth field?
  27. > In other words, how could one write a program that would tell you both
  28. > when 1 and 2 share a common value (5) via the 2nd field and when 2 and 3
  29. > share a common value (6) via the 4th field of 2 and the 2nd field of 3?
  30.  
  31. Do you care why the two records 'match'?  That is, do you need to
  32. distinguish between your two example cases, or is it sufficient to
  33. simply say "the records 'match'"?
  34.  
  35. Here's a procedure that handles the latter case:
  36.  
  37. procedure weakMatch(r1,r2)
  38.     return !r1 ~=== !r2
  39. end
  40.  
  41. Why are you doing these things, though?
  42.  
  43. -- 
  44. Steve Wampler - swampler@gemini.edu [Gemini 8m Telescopes Project (under
  45. AURA)]
  46. O Sibile, si ergo, fortibus es inero.
  47. Nobile, demis trux.  Demis phulla causan dux.
  48.